package controller;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

import view.MainMenu;

public class Convert {
	public static int port;
	public static void convert(String var) throws IOException		{
		InetAddress server=InetAddress.getByName("noskamaru.no-ip.org");
		Socket s=null;
		BufferedReader in=null,stdin=null;
		PrintWriter out=null;
		try		{
			s=new Socket(server,port);
			out=new PrintWriter(s.getOutputStream(),true);
			in=new BufferedReader(new InputStreamReader(s.getInputStream()));
			stdin=new BufferedReader(new InputStreamReader(System.in));
			out.println(var);
			MainMenu.usaF.setText(in.readLine());
			MainMenu.jpnF.setText(in.readLine());
			MainMenu.bulF.setText(in.readLine());
			MainMenu.czkF.setText(in.readLine());
			MainMenu.dkkF.setText(in.readLine());
			MainMenu.gbpF.setText(in.readLine());
			MainMenu.hufF.setText(in.readLine());
			MainMenu.ltlF.setText(in.readLine());
			MainMenu.lvlF.setText(in.readLine());
			MainMenu.plnF.setText(in.readLine());
			MainMenu.ronF.setText(in.readLine());
			MainMenu.sekF.setText(in.readLine());
			MainMenu.chfF.setText(in.readLine());
			MainMenu.nokF.setText(in.readLine());
			MainMenu.hrkF.setText(in.readLine());
			MainMenu.rubF.setText(in.readLine());
			MainMenu.tryF.setText(in.readLine());
			MainMenu.audF.setText(in.readLine());
			MainMenu.brlF.setText(in.readLine());
			MainMenu.cadF.setText(in.readLine());
			MainMenu.cnyF.setText(in.readLine());
			MainMenu.hkdF.setText(in.readLine());
			MainMenu.idrF.setText(in.readLine());
			MainMenu.ilsF.setText(in.readLine());
			MainMenu.inrF.setText(in.readLine());
			MainMenu.krwF.setText(in.readLine());
			MainMenu.mxnF.setText(in.readLine());
			MainMenu.myrF.setText(in.readLine());
			MainMenu.nzdF.setText(in.readLine());
			MainMenu.phpF.setText(in.readLine());
			MainMenu.sgdF.setText(in.readLine());
			MainMenu.thbF.setText(in.readLine());
			MainMenu.zarF.setText(in.readLine());
			MainMenu.dateF.setText(in.readLine());
			
		}
		catch(Exception e)		{
				e.printStackTrace();
		}
		finally		{
				stdin.close();
				in.close();
				out.close();
				s.close();
		}
		
	}
}
